<?php
require('../modelo/validar.php');
$obj = new validar();
$bandera = $obj->validar($_POST['username'], $_POST['password']);
	
	if($bandera == true){
		if ($_POST['username']!= 'admin' and $_POST['password']!= '1234'){
			header('Location:../vista/comentarios.php');
		}
		else{
			header('Location:../vista/admin.php');
		}
	}
	else
		echo "EL USUARIO NO EXISTE";
		echo "<br>";
		echo "<br>";
		echo "<a href=../vista/login.php>VOLVER AL LOGIN</a>";



	/*if (isset($_POST['Iniciar']) and ($_POST['Iniciar']== 'Iniciar')){
		if ($_POST['username'] and $_POST['password'] && ['nomb_us'] and ['contra_us']) {
			if ($_POST['username']!= 'jleonardo1' and $_POST['password']!='utcv1234'){
				require_once '../modelo/comentar.php';
				$comentar= new comentar();
				$comentar->validar();
				
				header('Location:../vista/comentarios.php');
			}
			else{
				header('Location:../vista/admin.php');
			}
		}
		else{
			echo "NO EXISTE EL USUARIO";
			exit;
		}
	}*/








	/*if(isset($_POST['Iniciar']) and ($_POST['Iniciar']= 'Iniciar')){
		if ($_POST['username']!='jleonardo1' and $_POST['password']!='utcv1234'){
			require_once '../modelo/comentar.php';
			$comentar= new comentar();
			$comentar->validar();
			header('Location:../vista/comentarios.php');
		}
		else{
			header('Location:../vista/admin.php');
		}
	}*/













/*if($bandera == true)
	header('Location:../vista/admin.php');
else
	header('Location:404.php');*/